﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;

namespace ElevatorSimulator
{
    public partial class LiftShaft : Panel
    {
        int shaftNo;
        int callerYPos = 5;
        Lift e;
        ArrayList floors;

        public LiftShaft(int shaftNo, int noFloors, int shaftWidth, int floorHeight)
        {
            this.shaftNo = shaftNo;
            floors = new ArrayList();
            e = new Lift(callerYPos);

            int t = 5;
            for (int i = 0; i < noFloors; i++)
            {
                //floors.Add(0,   t);
                t += 50;
            }
           // this.setName(Integer.toString(shaftNo));
           // this.setPreferredSize(new Dimension(shaftWidth, noFloors * floorHeight));
        }

        public LiftShaft()
        {
            InitializeComponent();
        }
        public void callElevator(int index)
        {
            this.callerYPos = (int)floors[index];
        }

        public String getLiftDirection()
        {
            return e.getDirection();
        }

        public int getLiftFloor()
        {
            return floors.IndexOf(e.getLiftCurrentYPos())+1;
        }

        public String getLiftStatus()
        {
            return e.getStatus();
        }
    }
}
